# Contributor: Holger Jaekel <holger.jaekel@gmx.de>
# Maintainer: Holger Jaekel <holger.jaekel@gmx.de>
pkgname=charls
pkgver=2.3.4
pkgrel=0
pkgdesc="optimized implementation of the JPEG-LS standard for lossless and near-lossless image compression"
url="https://github.com/team-charls/charls"
arch="all"
license="BSD-3-Clause"
makedepends="cmake"
subpackages="$pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/team-charls/charls/archive/$pkgver.tar.gz"

build() {
	cmake . \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=ON
	make
}

package() {
	make DESTDIR="$pkgdir" install
}

check() {
	# The testprogram requires "Press any key + 'enter' to exit program"
	echo "end\n" | ./test/charlstest -unittest
}
sha512sums="
3f6e1a054d5f7cfa5309e3d1b280d0dbaaeac7f06b08619cefe15677367631d9f6eb96e54b3e5ec921ac50793a570c39178c3e4b52ce9837b731bbccd6a3d0ad  charls-2.3.4.tar.gz
"
